package com.yksj.healthtalk.ui.friend;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;

import com.yksj.healthtalk.comm.BaseFragmentActivity;
import com.yksj.healthtalk.net.socket.SmartFoxClient;
import com.yksj.healthtalk.ui.R;
import com.yksj.healthtalk.utils.ToastUtil;
/**
 * 投诉用户
 * @author zhao
 */
public class UserReportActivity extends BaseFragmentActivity implements OnClickListener {
	EditText mEditText;
	TextView mTextView;
	String customerId;//客户id
	String merchantId;//商户id
	private int mContentCount=200;//字数限制
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.server_center_report_layout);
		initTitle();
		initView();
	}
	
	
	private void initView() {
		customerId = SmartFoxClient.getLoginUserId();
		mEditText  = (EditText)findViewById(R.id.commentEdit);
		findViewById(R.id.number_txt).setVisibility(View.GONE);
		titleTextV.setText("投诉");
		titleLeftBtn.setOnClickListener(this);
		titleRightBtn2.setVisibility(View.VISIBLE);
		titleRightBtn2.setOnClickListener(this);
		titleRightBtn2.setText("确定");
	}


	@Override
	public void onClick(View v) {
		switch(v.getId()){
		case R.id.title_right2:
			String content = mEditText.getEditableText().toString();
			if(!content.trim().equals("")){
				SmartFoxClient.report(getIntent().getStringExtra("id"),content);
				finish();
				ToastUtil.showToastPanl("提交成功");	
			}else{
				onBackPressed();
			}
			break;
		case R.id.title_back:
			onBackPressed();
			break;
		}
	}
	
	
}
